import BuffUtil from '@/BuffUtil';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
/**
 * 伤害加深
 **/
export default class BossSpell_HeartedMore extends AbilityBase {
    static instance: BossSpell_HeartedMore;
    buffType: AppBuffType = {
        id: 'buff_BossSpell_HeartedMore',
        art: this.art,
        name: this.abilityName,
        ubertip: this.ubertip,
        targetArt: 'Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl',
        targetAttach: 'origin',
        dur: 7,
        stackCountMax: -1,
    };
    constructor(id: string = 'Mxg1') {
        super(id);
        BossSpell_HeartedMore.instance = this;
        this.init();
        // se.onUnitSpellEffect(this.onSpellEffect.bind(this), this.id);
        EventManager.onBeforApplyAttack(this.onSpellEffect.bind(this));
    }
    init() {
        BuffUtil.registerBuffType(this.buffType);
    }
    cast<T extends Object = any>(tarX: number, tarY: number, source: unit, target: unit, data?: T): void {}
    onSpellEffect(d: DamageEventData) {
        if (GetUnitAbilityLevel(d.source, this.id) == 0) return;
        let buff = BuffUtil.addBuff(d.target, this.buffType.id, d.source);
        let dmg = 150 * buff.stackCount;
        d.initDamage += dmg;
    }
}
